home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
gfa
/
gfa_enforcer.txt
next >
Wrap
Text File
|
1999-07-21
|
2KB
|
104 lines
GFA-Basic: Errors
-----------------
GFA-Basic is known to throw a lot of Enforcer hits.
The TITLEW command accessses illegal memory addresses. Thus you should
not use this command.
The following piece of code replaces the TITLEW and CLOSEW commands. Note
that 3 arrays have to be DIM'ed and initialized before using the new
procedures.
@wintitle(window #, "Window Title")
@winclose(window #)
Replace window # by the number of your window. Replace 20 by the maximum
number of windows you want to use.
GFA-Basic Fehler
----------------
GFA-Basic wirft bekanntlich eine Menge Enforcer-Hits.
Das Hauptproblem ist der Befehl TITLEW, der ungültige Speicheradressen
anspricht. Statt dieses Befehls sollte direkt das Betriebssystem benutzt
werden.
Die folgenden Prozeduren ersetzen die Befehle TITLEW und CLOSEW. Vor
ihrer Verwendung müssen 3 Felder (Arrays) dimensioniert und initialisiert
werden.
@wintitle(window #, "Window Title")
@winclose(window #)
Ersetzen Sie window # durch die Nummer des Fensters und 20 durch die
höchste in dem Programm benutzte Fensternummer.
Code
----
' Initialization *** Initialisierung
DIM win%(20),cgt%(20),cgt$(20)
FOR t%=0 TO 20
win%(t%)=0
cgt%(t%)=0
cgt$(t%)=""
NEXT t%
' Procedures *** Prozeduren
PROCEDURE wintitle(win%,title$)
LOCAL a%,b%,t%,l%
IF WINDOW(win%)<>win%(win%)
cgt%(win%)=0
win%(win%)=WINDOW(win%)
ENDIF
IF cgt%(win%)>0
~FreeMem(cgt%(win%),1000)
ENDIF
cgt%(win%)=AllocMem(1000,65539)
IF cgt%(win%)>0
a%=WINDOW(win%)
cgt$(win%)=title$+CHR$(0)
b%=VARPTR(cgt$(win%))
l%=LEN(cgt$(win%))
IF (l%>0)
BMOVE V:cgt$(win%),cgt%(win%),l%
ELSE
POKE cgt%(win%),0
ENDIF
~SetWindowTitles(a%,cgt%(win%),cgt%(win%))
ENDIF
RETURN
PROCEDURE winclose(win%)
win%(win%)=TIMER
CLOSEW #win%
RETURN
Distribution
------------
--- Public Domain ---
You may use this code in your own programs.
Sie dürfen den Code in Ihre eigenen Programme einbauen.
Contact / Kontakt
-----------------
Frank Reibold
Ottberger Weg 13
31737 Rinteln
GERMANY